(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.segment.viewController', viewController);
	viewController.$inject = [ '$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'segmentService' ];
	function viewController($scope, Constants, layoutConfig, validatorConfig, gridService, authService, segmentService) {
		var ctrl = this, segmentInfo = $scope.$stateParams.params;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;
		ctrl.segment={};
		ctrl.init = function() {
			var params = {
					segmentCode : segmentInfo.segmentCode
			};
			return authService.view(params).then(function(response) {
				ctrl.segment = response.data || segmentInfo;
			}, angular.noop);
		};
	}
})(angular);